let SyncTemplate = `
<div class="container">
   <div class="row">
    <div class="col-3">
     <input class="form-control" type="date" v-model="syncDate">
    </div>
    <div class="col-2">
        <button @click="sync" class="btn btn-primary">同步</button>
    </div>
  </div>
  <hr>
  <div>
    <div class="row">
    <div class="col-3">
     <input class="form-control" type="date" v-model="queryDate">
    </div>
    <div class="col-3">
        <input class="form-control" type="text" v-model="queryID" placeholder="id">
    </div>
    <div class="col-3">
        <button @click="query" class="btn btn-primary">查询</button>
    </div>
  </div>
  </div>
  <hr>
</div>

`

const Sync = Vue.component('sync', {
    template: SyncTemplate,
    data(){
        return {syncDate: new Date(), queryDate: new Date(), queryID:""}
    },
    created() {},
    methods:{
        sync(){
            let pickDate = new Date(this.syncDate);
            $.get("/api/db/sync", {time: Math.round(pickDate.getTime() / 1000)}).done(()=>{
                confirm(pickDate + "同步成功！")
            }).fail((resp)=>{
                confirm(pickDate + "同步失败！")
            })
        },
        query(){

        }
    }

});